package hackthon.dao;

import hackthon.pojo.Email;
import org.springframework.stereotype.Repository;

/**
 * Created by wuwenhao on 15/1/8.
 */

@Repository
public class EmailDao extends BaseDao{

    public int addEmail(Email email){
        return (Integer)getSqlMapClientTemplate().insert(getNameSpace() + ".newEmail", email);
    }

    public Email getEmailById(int emailId){
        return (Email)getSqlMapClientTemplate().queryForObject(getNameSpace()+".getEmailById",emailId);
    }
    @Override
    public String getNameSpace() {
        return "myemail";
    }

}
